home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
64-bit_x64
/
Russian
/
cpsimage.cab
/
data
/
xps
/
XpsSequence.elf
< prev
Wrap
Text File
|
2009-04-23
|
2KB
|
66 lines
#load "xps/XpsDocument.elf";
/****************************************************************************/
/*
** This class defines a XPS FixedDocumentSequence part.
*/
/* @appendDocument Appends a XpsDocument to end of document list. */
/* @getDocument Gets the specified XpsDocument from document list. */
/* @getDocumentCount Gets the number of XpsDocument objects in document list. */
/* @insertDocument Inserts a XpsDocument into document list. */
/* @prependDocument Prepends a XpsDocument to beginning of document list. */
/* @removeDocument Removes the specified XpsDocument from document list. */
/****************************************************************************/
CLASS XpsSequence EXTENDS XpsPackagePart {
// Fields
LIST documents;
// Methods
METHOD insertDocument (INTEGER docNum, XpsDocument doc) {
INTEGER docCount = this.documents.length ();
if ((docNum < 1) || (docNum > docCount+1)) {
SetStatus (
op: "stop",
msg: "Invalid document number <" + docNum + ">\n"
);
return;
}
this.documents.insert (entry: docNum-1, obj: doc);
}
METHOD prependDocument (XpsDocument doc) {
this.insertDocument (doc: doc, docNum: 1);
}
METHOD appendDocument (XpsDocument doc) {
INTEGER docCount = this.documents.length ();
this.insertDocument (doc: doc, docNum: docCount+1);
}
METHOD removeDocument (INTEGER docNum) {
this.documents.remove (entry: docNum-1);
}
METHOD getDocumentCount ()
RETURNS (INTEGER count) {
count = this.documents.length ();
}
METHOD getDocument (INTEGER docNum)
RETURNS (XpsDocument doc) {
INTEGER docCount = this.documents.length ();
if ((docNum < 1) || (docNum > docCount)) {
SetStatus (
op: "stop",
msg: "Invalid document number <" + docNum + ">\n"
);
return;
}
doc = this.documents[docNum-1];
}
}